"""
MonoNeurona 2008
GPLv3

Coatl -- CMS
"""
from django.db import models
from datetime import datetime
from django.contrib.auth.models import User, UserManager
from django.contrib.sites.models import Site 
from django.core.mail import send_mail
from django.utils.translation import ugettext as _
from django.contrib.syndication.feeds import Feed


class Theme(models.Model):
   theme = models.CharField(max_length=30, unique=True)
   description = models.CharField(max_length=100)
   
   def __unicode__(self):
       return u'%s %s' % (self.theme, self.description)

class Post(models.Model):
  author    = models.ForeignKey(User, verbose_name=_('Author'),editable=False)
  date      = models.DateTimeField()
  title     = models.CharField(max_length=100)
  post      = models.TextField()
  status    = models.BooleanField(default=False)
  comment   = models.BooleanField(default=True)
  theme     = models.ForeignKey(Theme)
  
  def __unicode__(self):
       return self.title                           

class Comment(models.Model):
  author    = models.ForeignKey(User,editable=False)
  date      = models.DateTimeField()
  website   = models.CharField(max_length=100)
  comment   = models.TextField()
  status    = models.BooleanField(default=True)

class BlogFeed(Feed):
  title = "Blog Title"
  link = "/blog/"
  description = "My random thoughts and musings on a variety of subjects."
  def items(self):
    return get_items("blog")



